package chapter02;

import java.util.Scanner;

public class gao9 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int sum = 0;// 记录总分

        boolean flag = true;// false

        // 求总分
        for (int i = 1; i <= 5; i++) {
            System.out.println("请录入" + i + "门课成绩：");
            int score = sc.nextInt();
            if (score < 0 || score > 100) {
                flag = false;
                break;
            }
            sum += score;
        }

        // if(flag == true){
        if (flag){
            System.out.println("平均分：" + sum / 5.0);
        } else {
            System.out.println("录入分数有五");
        }
    }
}